package com.syg.boot.util.json;

import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import java.lang.reflect.Type;

public class GsonErrCdEnumTypeAdapter implements JsonSerializer<GsonErrCdEnum>, JsonDeserializer<GsonErrCdEnum> {
    public GsonErrCdEnumTypeAdapter() {
    }

    @Override
    public JsonElement serialize(GsonErrCdEnum src, Type typeOfSrc, JsonSerializationContext context) {
        return src != null ? new JsonPrimitive(src.getValue()) : null;
    }

    @Override
    public GsonErrCdEnum deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
        return null;
    }
}

